package com.youan.log.modules.audit.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.youan.log.modules.audit.entity.SdAttackSuccess;
import com.youan.log.modules.audit.service.ISdAttackSuccessService;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@AllArgsConstructor
@RequestMapping("/sd-attack-success")
@Api(value = "", tags = "接口")
public class SdAttackSuccessController {

    @Autowired
    private ISdAttackSuccessService sdAttackSuccessService;

    @GetMapping("groupByAttackCity")
    public R<IPage<SdAttackSuccess>> getPageGroupByAttackCity(SdAttackSuccess sdAttackSuccess, Query query) {
        IPage<SdAttackSuccess> result = sdAttackSuccessService.getPageGroupByAttackCity(Condition.getPage(query), sdAttackSuccess);
        return R.data(result);
    }

    @GetMapping("detail")
    public R<List<SdAttackSuccess>> detail(SdAttackSuccess sdAttackSuccess) throws Exception {
        List<SdAttackSuccess> result = sdAttackSuccessService.detail(sdAttackSuccess);
        return R.data(result);
    }

}
